/*
 * DictionaryIterator.cpp
 *
 *  Created on: 26/05/2010
 *      Author: prodrig
 */

#include "DictionaryIterator.h"
#include "IKey.h"

DictionaryIterator::DictionaryIterator(IIterator *iter, IDictionary *iDic) {
	it = iter;
	dic = iDic;
}

bool DictionaryIterator::hasCurrent() {
	return it->hasCurrent();
}

void DictionaryIterator::next() {
	it->next();
}

ICollectible *DictionaryIterator::current() {
	IKey *key = (IKey*)it->current();
	return dic->find(key);
}

DictionaryIterator::~DictionaryIterator() {
	delete it;
}
